import React from 'react'
import {Outlet ,  useNavigate} from 'react-router-dom'

export default function Home() {
  /* 
    使用NavLink或者Link进行跳转 被称作为声明式路由导航
    使用navigte方法进行路由跳转,被称作为编程式路由导航
  
  */
 const navigate = useNavigate();

  //点击去music
  const toMusicHandle = () => {
    navigate("/main/home/music?name=厉飞雨&age=18")
  }

  //点击去news
  const toNewsHandle = () => {
    navigate("/main/home/news?name=韩立&age=14300")
  }

  return (
    <div>
      <h3>我是Home的内容</h3>
      <button onClick = {toMusicHandle}>music</button>
      <button onClick = {toNewsHandle}>news</button>
      <Outlet/>
    </div>
  )
}
